
var TOGACOM = TOGACOM || {};

TOGACOM.namespace = function (ns_string) {
		var parts = ns_string.split("."),
			parent = TOGACOM,
			i;
		
		if(parts[0] === "TOGACOM") {
			parts = parts.slice(1);
		}

		for(i = 0; i < parts.length; i += 1) {
			if(typeof parent[parts[i]] === "undefined" ) {
				parent[parts[i]] = {};
			}

			parent = parent[parts[i]];
		}

		return parent;
};


var AJAX = TOGACOM.namespace("TOGACOM.AJAX");

AJAX.addBoardRecommandCount = function() {
	var boardSeqElem = $("#board-seq");
	$.ajax({
		url : "/jmlim-blog/boardRecommandCount.do",
		// type: "POST",
		// data: ({Id:$("#Id").val(), Pwd:$("#Pwd").val()}),
		data : ({
			boardSeq : boardSeqElem.val()
		}),
		error: function(request, textStatus, errorThrown){
		},
		// contentType: "text/plain; charset=euc-kr",
		success : function(data) {
			if (data != null) {
				$("#board-recommand-count .num").val(data);
			} else {
				alert("실패");
			}
		}
	});
};